import { User } from '../login/model/user';
import { Component, OnInit } from '@angular/core';
import { NgForm} from '@angular/forms';

@Component({
  selector: 'register',
  templateUrl: './register.component.html',
  styleUrls: ['./register.component.scss']
})
export class RegisterComponent implements OnInit {
  public selectedOption:string="+86";
  public user:User=new User();
  public confirmPassword:string;
  public validateStatuErrors:any={
    success:"",
    warning:"",
    error:"",
    validating:"",
  };
 
  // const enum Errors {
  //   up
  // };

  constructor(
  ) { }

  ngOnInit() {
    const a=5;
  }

  /**
   * 测试ngModelChange事件
   * 
   * @param {string} name 
   * @memberof RegisterComponent
   */
  userNameChange(name:string){
    console.log("这是用户名输入框监听事件");
    console.log(name);

    this.validateStatuErrors.error="error";  //验证不通过
  }

    /**
     *  #myForm="ngForm 将ngForm指令导出到本地模板变量中，详见api中ngForm
    */
 public userRegister(f:NgForm){
   console.log("form表单提交");
  console.log(f);
 }

 /**
  * 判定二次密码输入是否一致
  */
 confirmPasswordChange(Pwd:any){
    console.log("这是第一次输入密码值："+Pwd.value);
    console.log("这是确认密码值："+this.confirmPassword);
 }

}
